<?php

function pageURL() {

	$pageURL = "http";
	if ($_SERVER["HTTPS"] == "on")
	{
		$pageURL .= "s";
	}
	$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80")
	{
		$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
	}
	 else 
	{
		$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
	}
	return $pageURL;
}


ob_start();
error_reporting(0);
set_time_limit(0);
ini_set("memory_limit", "100M");
require_once "includes/dbconfig.php";
require_once "includes/functions.php";
$site_url = pageurl();
$site_url = substr($site_url, 0, strrpos($site_url, "/") + 1);
if (mysql_num_rows(mysql_query("SELECT * FROM settings")) > 1)
{
	die("You have already database tables installed, if you want to run installer, please remove tables from database and run this script again to setup site");
}
if (isset($_POST["save"]))
{
	$SETTING["site_url"] = makesafe($_POST["site_url"]);
	$SETTING["site_name"] = makesafe($_POST["site_name"]);
	$SETTING["site_description"] = makesafe($_POST["site_description"]);
	$SETTING["site_keywords"] = makesafe($_POST["site_keywords"]);
	$SETTING["notification_email"] = makesafe($_POST["notification_email"]);
	$SETTING["admin_email"] = makesafe($_POST["admin_email"]);
	if (empty($SETTING["site_name"]) || empty($SETTING["site_url"]) || empty($SETTING["site_description"]) || empty($SETTING["site_keywords"]) || empty($SETTING["notification_email"]) || empty($SETTING["admin_email"]))
	{
		$error = "All fields are required.";
	}
	if (preg_match("/[^0-9A-Za-z_-]/", $SETTING["site_name"]))
	{
		$error = "Site name should have only letters and numbers and underscore. No spaces allowed";
	}
	if (empty($SETTING["site_url"]))
	{
		$error = "Site url is required.";
	}
	if (empty($error))
	{
		$query["Creating Settings Table"] = "CREATE TABLE IF NOT EXISTS `settings` (\r
  `option` varchar(50) NOT NULL,\r
  `value` text,\r
  PRIMARY KEY (`option`)\r
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
		$query["Inserting Values To Settings Table"] = "INSERT INTO `settings` (`option`, `value`) VALUES ('admin_email', NULL),('min_cashout_limit', '10'),('notification_email', NULL),('site_description', NULL),('site_keywords', NULL),('site_url', NULL),('business_paypal_email', NULL),('offer_rate', 30),('referral_rate', 15),('allow_messaging', 1),('premium_rate', 20),('site_logo', '0'),('site_name', NULL),('quick_pay_fee', '2'),('quick_pay_flat_fee','0'),('quick_pay_available', '0'),('premium_link_unlock', '1'), ('c_date1', '0'), ('c_date2', '0');";
		$query["Creating Pending Users Table"] = "CREATE TABLE IF NOT EXISTS `pending_users` (\r
  `email` varchar(255) NOT NULL,\r
  `token` char(12) NOT NULL,\r
  PRIMARY KEY (`email`)\r
);";
		$query["Creating Users Table"] = "\r
CREATE TABLE IF NOT EXISTS `users` (\r
  `uid` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `firstname` VARCHAR(100),\r
  `lastname` VARCHAR(100),  \r
  `username` varchar(20) NOT NULL,\r
  `password` varchar(42) NOT NULL,\r
  `salt` varchar(6) NOT NULL,\r
  `email_address` varchar(50) NOT NULL,\r
  `address` TEXT,\r
  `city` VARCHAR(50),\r
  `state` VARCHAR(200),\r
  `zip` VARCHAR(20),\r
  `country` VARCHAR(100),\r
  `phone` VARCHAR(100),\r
  `websites` TEXT,\r
  `gender` VARCHAR(6) DEFAULT 'Male',\r
  `referrer_id` bigint(20) NOT NULL,\r
  `active` int(11) NOT NULL DEFAULT '0',\r
  `ip_address` varchar(16) NOT NULL,\r
  `date_registration` datetime NOT NULL,\r
  `offer_rate` DECIMAL (5,2) DEFAULT '0.00',\r
  `referral_rate` DECIMAL (5,2) DEFAULT '0.00' COMMENT 'How much this user will get from Referral',\r
  `premium_rate` DECIMAL (5,2) DEFAULT '0.00',    \r
  `isBan` int DEFAULT '0',\r
  `isLocked` int DEFAULT '0',\r
  `l_hideuser` INT DEFAULT '0',\r
  `l_hideEarnings` INT DEFAULT '0',\r
  `balance` decimal(20,4) DEFAULT '0.0000',\r
  `promotional_methods` TEXT,\r
  PRIMARY KEY (`uid`)\r
) AUTO_INCREMENT=100 ;";
		$query["Creating Files Table"] = "\r
CREATE TABLE files\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`uid` BIGINT(20) NOT NULL,\r
`filename` TEXT NOT NULL COMMENT 'Orignal File Name',\r
`encodedname` TEXT COMMENT 'Name of Saved file',\r
`code` TEXT,\r
`filesize` BIGINT(20),\r
`hits` BIGINT(20) DEFAULT '0',\r
`downloads` BIGINT(20) DEFAULT '0',\r
`dateadded` DATETIME,\r
`last_download_date` DATETIME,\r
`folder_id` BIGINT DEFAULT '0',\r
`description` TEXT,\r
`upload_type` VARCHAR(20) COMMENT 'remote or local',\r
`link_url` TEXT,\r
`link_desc` TEXT\r
)AUTO_INCREMENT=1000;";
		$query["Creating Cashout Table"] = "\r
CREATE TABLE IF NOT EXISTS `cashouts` (\r
  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `uid` bigint(20) NOT NULL,\r
  `amount` decimal(12,2) NOT NULL,\r
  `status` varchar(20) DEFAULT 'Unpaid',\r
  `method` varchar(30) DEFAULT 'paypal',\r
  `user_notes` text,\r
  `admin_notes` text,\r
  `request_date` datetime DEFAULT NULL,\r
  `payment_date` datetime DEFAULT NULL,\r
  `email_address` VARCHAR(120) DEFAULT NULL,\r
  `priority` varchar(50) default 'normal',\r
  `fee` DECIMAL(12,2) NOT NULL DEFAULT '0.00',\r
  `type` VARCHAR(10) COMMENT 'u.s/intl',\r
  `check_payto` VARCHAR(255),\r
  `check_address` TEXT,\r
  `check_address2` TEXT,\r
  `check_country` VARCHAR(100),\r
  `first_name` VARCHAR(255),\r
  `last_name` VARCHAR(255),\r
  `dd_address` VARCHAR(255),\r
  `city` VARCHAR(255),\r
  `state` VARCHAR(100),\r
  `zip` VARCHAR(30),\r
  `routing_number` VARCHAR(100),\r
  `account_number` VARCHAR(100),\r
  `bank_name` VARCHAR(255),\r
  `bank_address` VARCHAR(255),\r
  `bank_city` VARCHAR(255),\r
  `bank_state` VARCHAR(50),\r
  `bank_zip` VARCHAR(50),\r
  `bank_country` VARCHAR(50),\r
  `bank_routing` VARCHAR(50),\r
  `bank_account_number` VARCHAR(50),\r
  `benef_bank_name` VARCHAR(255),\r
  `benef_bank_address` VARCHAR(255),\r
  `benef_account_number` VARCHAR(50),\r
  `benef_swift` VARCHAR(50),\r
  `correspondent_bank` VARCHAR(255),\r
  PRIMARY KEY (`id`)\r
);\r
";
		$query["Creating Admins Table"] = "CREATE TABLE IF NOT EXISTS `admins` (\r
  `aid` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `admin_user` varchar(50) NOT NULL,\r
  `admin_password` varchar(42) NOT NULL,\r
  `active` int(11) DEFAULT NULL,\r
  `date` datetime DEFAULT NULL,\r
  PRIMARY KEY (`aid`)\r
);";
		$query["Inserting Admin Account"] = "INSERT INTO admins VALUES (1, 'admin', 'd94354ac9cf3024f57409bd74eec6b4c', '1', NOW());";
		$query["Creating Premium Packages Table"] = "CREATE TABLE IF NOT EXISTS `premium_packages` (\r
  `pid` int(11) NOT NULL AUTO_INCREMENT,\r
  `name` varchar(255) NOT NULL,\r
  `expiry_period` int(11) NOT NULL COMMENT 'Expiry Period In Days',\r
  `cost` decimal(15,2) DEFAULT NULL,\r
  `active` int(11) DEFAULT '1',\r
  `hosted_button_id` TEXT,\r
  `period_type` TEXT COMMENT 'day or month',\r
  PRIMARY KEY (`pid`)\r
);";
		$query["Creating Premium Accounts Table"] = "CREATE TABLE IF NOT EXISTS `premium_accounts` (\r
  `uid` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `package_id` int(11) NOT NULL,\r
  `email_address` varchar(50) NOT NULL COMMENT 'Credit Buyer email',\r
  `password` varchar(42) NOT NULL,\r
  `expiry_date` datetime DEFAULT NULL,\r
  `active` int(11) DEFAULT '0' COMMENT 'premium account can be used once its activated',\r
  `package_name` TEXT,\r
  `date` DATETIME,\r
  `code` TEXT,\r
  PRIMARY KEY (`uid`)\r
);";
		$query["Creating Networks Table"] = "CREATE TABLE IF NOT EXISTS `networks` (\r
  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `name` varchar(50) NOT NULL,\r
  `active` int(11) DEFAULT '1',\r
  PRIMARY KEY (`id`)\r
) ;";
		$query["Inserting Networks"] = "INSERT INTO `networks` (`id`, `name`, `active`) VALUES\r
(1, 'Adscendmedia', 1),\r
(2, 'Adworkmedia', 1),\r
(3, 'Adgatemedia', 1),\r
(4, 'Maxbounty', 1),\r
(5, 'CPALead', 1),\r
(6, 'adshiftmedia', 1),\r
(7, 'Adnooka', 1);";
		$query["Creating Offers Table"] = "CREATE TABLE IF NOT EXISTS `offers` (\r
  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `name` text NOT NULL,\r
  `description` text DEFAULT NULL,\r
  `link` text,\r
  `active` int(11) DEFAULT '1',\r
  `credits` decimal(20,2) DEFAULT '0.00',\r
  `hits` bigint(20) DEFAULT '0',\r
  `limit` int(11) DEFAULT '0' COMMENT 'Hits Limit',\r
  `countries` text,\r
  `date` datetime DEFAULT NULL,\r
  `network` varchar(20) DEFAULT NULL,\r
  `campaign_id` varchar(100) DEFAULT NULL,\r
  `leads` BIGINT(20),\r
  `epc` DECIMAL(10,2),\r
  `mobile` int COMMENT 'Pin Confirm Offer',\r
  PRIMARY KEY (`id`)\r
);";
		$query["Altering Offers Table"] = "ALTER TABLE `offers` CHANGE `name` `name` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;";
		$query["Altering Offers Table"] = "ALTER TABLE `offers` CHANGE `description` `description` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;";
		$query["Creating Offer Process Table"] = "CREATE TABLE IF NOT EXISTS `offer_process` (\r
  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `campaign_id` bigint(20) NOT NULL,\r
  `offer_name` text,\r
  `uid` bigint(20) NOT NULL,\r
  `code` varchar(255) DEFAULT NULL,\r
  `status` int(11) DEFAULT '0',\r
  `date` datetime DEFAULT NULL,\r
  `ip` varchar(16) NOT NULL,\r
  `credits` decimal(20,2) DEFAULT NULL,\r
  `ref_credits` decimal(20,2) DEFAULT NULL,\r
  `network` varchar(20) DEFAULT NULL,\r
  `offer_id` bigint(20) DEFAULT NULL,\r
  `file_id` BIGINT(40),\r
  `credit_mode` VARCHAR(100) DEFAULT 'default',\r
  `country` VARCHAR(255),\r
  `source` VARCHAR(255),\r
  `unique` INT DEFAULT 0,\r
  PRIMARY KEY (`id`)\r
);";
		$query["Creating Earnings Log Table"] = "\r
CREATE TABLE IF NOT EXISTS `earnings_log` (\r
  `id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `uid` bigint(20) NOT NULL,\r
  `file_id` BIGINT(20) NOT NULL,\r
  `src_uid` bigint(20) DEFAULT '0' COMMENT 'Earn from user like referral',\r
  `src_offer_id` bigint(20) DEFAULT '0' COMMENT 'Offer ID, Commission earned from',\r
  `offer_name` text,\r
  `credits` decimal(10,2) DEFAULT '0.00',\r
  `notes` text,\r
  `date` datetime DEFAULT NULL,\r
  `network` varchar(255) DEFAULT NULL,\r
  PRIMARY KEY (`id`)\r
);";
		$query["Creating Referral Income Log Table"] = "CREATE TABLE IF NOT EXISTS `referral_income_log` (\r
  `log_id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `referral_id` bigint(20) NOT NULL,\r
  `referrer_id` bigint(20) NOT NULL,\r
  `credits` decimal(14,2) DEFAULT NULL,\r
  `date` datetime DEFAULT NULL,\r
  PRIMARY KEY (`log_id`)\r
);";
		$query["Creating Paypal Payments Table"] = "CREATE TABLE paypal_payments(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`txn_id` TEXT,\r
`item_name` TEXT,\r
`buyer_email` VARCHAR(255),\r
`payment` DECIMAL(20,2),\r
`date` DATETIME\r
);";
		$query["Creating Downloads Log Table"] = "CREATE TABLE downloads_log\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`file_uniqid` VARCHAR(100),\r
`download_address` TEXT,\r
`download_type` VARCHAR(100) COMMENT 'regular or premium',\r
`ip_address` VARCHAR(20),\r
`date` DATETIME,\r
`uploader_id` BIGINT,\r
`country` VARCHAR(100),\r
`referrer` TEXT,\r
`premium_email` VARCHAR(255)\r
);";
		$query["Creating Ready Downloads Table"] = "CREATE TABLE ready_downloads\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`hash` TEXT,\r
`file_id` BIGINT(20),\r
`date` DATETIME,\r
`download_type` VARCHAR(255)\r
);";
		$query["Creating Files Report Table"] = "CREATE TABLE file_reports(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`name` VARCHAR(255),\r
`email` VARCHAR(255),\r
`file_id` BIGINT(20),\r
`message` TEXT,\r
`ip` VARCHAR(20),\r
`date` DATETIME\r
);";
		$query["Creating Banned Offers Table"] = "CREATE TABLE banned_offers\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`camp_id` VARCHAR(50),\r
`network` VARCHAR(255),\r
`date` DATETIME\r
);\r
";
		$query["Creating Bans Table"] = "CREATE TABLE `bans` (\r
  `uid` bigint(20) NOT NULL,\r
  `reason` text,\r
  `date` datetime default NULL,\r
  `case` varchar(20) default NULL,\r
  PRIMARY KEY  (`uid`)\r
);";
		$query["Creating IPBans Table"] = "CREATE TABLE `ipbans` (\r
  `ip` varchar(20) NOT NULL,\r
  `scope` varchar(20) NOT NULL,\r
  `date` datetime default NULL,\r
  PRIMARY KEY  (`ip`)\r
);\r
";
		$query["Creating News Table"] = "\r
CREATE TABLE news\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`title` VARCHAR(255),\r
`written_by` VARCHAR(255),\r
`description` TEXT,\r
`date` DATETIME,\r
`img` VARCHAR(255)\r
);\r
";
		$query["Creating Messages Table"] = "CREATE TABLE IF NOT EXISTS `messages` (\r
  `msg_id` bigint(20) NOT NULL AUTO_INCREMENT,\r
  `sender` varchar(255) NOT NULL,\r
  `receiver` varchar(255) NOT NULL,\r
  `subject` varchar(255) NOT NULL,\r
  `message` text NOT NULL,\r
  `date` datetime DEFAULT NULL,\r
  `read` int(11) DEFAULT '0',\r
  PRIMARY KEY (`msg_id`)\r
);\r
";
		$query["Creating Gateways Table"] = "\r
CREATE TABLE gateways(\r
`gid` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`uid` BIGINT(20) NOT NULL,\r
`name` VARCHAR(150) NOT NULL,\r
`title` TEXT NOT NULL,\r
`instructions` TEXT,\r
`min_offer_required` BIGINT(20),\r
`countries` TEXT COMMENT 'Gateway will be shown in specified countries or All',\r
`background_img_url` TEXT,\r
`background_color` VARCHAR(50),\r
`overlay_color` VARCHAR(10),\r
`overlay_opacity` INT,\r
`width` BIGINT(20),\r
`height` BIGINT(20),\r
`title_color` VARCHAR(10),\r
`title_size` INT,\r
`title_font` VARCHAR(20),\r
`offer_color` VARCHAR(10),\r
`offer_size` INT,\r
`offer_bold` INT,\r
`offer_font` VARCHAR(20),\r
`instructions_color` VARCHAR(10),\r
`instructions_size` INT,\r
`instructions_font` VARCHAR(20),\r
`border_color` VARCHAR(10),\r
`border_size` INT,\r
`unlock_period` INT,\r
`ip_lock` INT,\r
`redirect_url` TEXT,\r
`start_delay` INT,\r
`include_close` INT,\r
`date` DATETIME,\r
`ip` VARCHAR(20),\r
`wid` BIGINT(20),\r
`offers_show` BIGINT(20),\r
`period_type` VARCHAR(20)\r
) ENGINE = MYISAM AUTO_INCREMENT=100;\r
";
		$query["Creating Gateway Sessions Table"] = "CREATE TABLE gw_sessions(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`uid` BIGINT(20),\r
`gid` BIGINT(20),\r
`session_id` VARCHAR(255),\r
`complete` INT DEFAULT '0',\r
`ip` VARCHAR(20),\r
`date` DATETIME\r
)ENGINE = MYISAM;\r
";
		$query["Creating Gateway Session Offers Table"] = "CREATE TABLE gw_session_offers\r
(\r
`id` BIGINT(20) AUTO_INCREMENT PRIMARY KEY,\r
`session_id` TEXT,\r
`gid` VARCHAR(20),\r
`offer_id` BIGINT(20),\r
`status` VARCHAR(50),\r
`date` DATETIME,\r
`offer_name` text,\r
`uid` bigint(20) NOT NULL,\r
`credits` decimal(20,2) DEFAULT NULL,\r
`ref_credits` decimal(20,2) DEFAULT NULL,\r
`network` varchar(20) DEFAULT NULL,\r
`credit_mode` VARCHAR(100) DEFAULT 'default',\r
`country` VARCHAR(255),\r
`source` VARCHAR(255),\r
`unique` INT DEFAULT 0,\r
`ip` VARCHAR(20)\r
)ENGINE = MYISAM;";
		$query["Creating Gateway Offers Table"] = "CREATE TABLE IF NOT EXISTS `gw_offers` (\r
  `id` bigint(20) PRIMARY KEY AUTO_INCREMENT,\r
  `name` text   CHARACTER SET utf8 COLLATE utf8_unicode_ci,\r
  `description` text  CHARACTER SET utf8 COLLATE utf8_unicode_ci,\r
  `link` text,\r
  `active` int(11) DEFAULT '1',\r
  `credits` decimal(20,2) DEFAULT '0.00',\r
  `hits` bigint(20) DEFAULT '0',\r
  `limit` int(11) DEFAULT '0' COMMENT 'Hits Limit',\r
  `countries` text,\r
  `date` datetime DEFAULT NULL,\r
  `network` varchar(20) DEFAULT NULL,\r
  `campaign_id` varchar(100) DEFAULT NULL,\r
  `leads` BIGINT(20),\r
  `epc` DECIMAL(10,2),\r
  `mobile` int COMMENT 'Pin Confirm Offer'\r
);";
		$query["Altering Gateway Offers Table"] = "ALTER TABLE `gw_offers` CHANGE `name` `name` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;";
		$query["Altering Gateway Offers Table"] = "ALTER TABLE `gw_offers` CHANGE `description` `description` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;";
		$query["Creating Gateway Stats Table"] = "CREATE TABLE gw_stats\r
(\r
  `id` BIGINT(20) PRIMARY KEY AUTO_INCREMENT,\r
  `gid` BIGINT(20),\r
  `offer_camp_id` VARCHAR(20),\r
  `credits` DECIMAL(15,2),\r
  `date` DATETIME\r
);";
		$query["Creating Files Comments Table"] = "\r
CREATE TABLE file_comments(\r
`id` BIGINT(20) PRIMARY KEY AUTO_INCREMENT,\r
`file_id` BIGINT(20),\r
`name` varchar(255),\r
`message` TEXT,\r
`date` DATETIME\r
);\r
\r
";
		$query["Creating Networks Settings Table"] = "	\r
CREATE TABLE networks_settings\r
(\r
    `adscend_pub_id` VARCHAR(255),\r
    `adscend_key` VARCHAR(255),\r
    `adgate_url` VARCHAR(255),\r
    `adwork_url` VARCHAR(255),		\r
	`cpalead_url` VARCHAR(255),\r
	`adshiftmedia_url` VARCHAR(255),\r
	`adnooka_url` VARCHAR(255)\r
	\r
);";
		$query["Completing Tables Creation."] = "INSERT INTO networks_settings VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL);";
		$query["Altering Tables-1"] = "ALTER TABLE referral_income_log ADD COLUMN campid BIGINT(20);";
		$query["Altering Tables-2"] = "ALTER TABLE referral_income_log ADD COLUMN network VARCHAR(25);";
		$query["Altering Tables-3"] = "ALTER TABLE referral_income_log ADD COLUMN hash VARCHAR(50);";
		$query["Altering Tables-4"] = "ALTER TABLE earnings_log ADD COLUMN hash VARCHAR(50);";
		$query["Altering Tables-5"] = "ALTER TABLE users ADD COLUMN email_verified INT DEFAULT '0';";
		$query["Inserting Settings Values"] = "INSERT INTO settings VALUE('auto_approve', '1');";
		foreach ($query as $k => $q)
		{
			if (mysql_query($q))
			{
				echo $k . " ====================== Done <br />";
				continue;
			}
			echo $fp;
			die(mysql_error());
			continue;
		}
		foreach ($SETTING as $key => $val)
		{
			if (mysql_query('' . "UPDATE settings SET  `value` = '" . $val . "' WHERE `option` = '" . $key . "' "))
			{
				$updated = 1;
				continue;
			}
			$updated = false;
			continue;
		}
		if ($updated == "1")
		{
			ob_end_clean();
			echo "\r
<div style=\"background:#eeeeee; width:500px; height:300px; margin:0 auto; border:1px solid #cccccc; -moz-border-radius: 5px;  -webkit-border-radius: 5px;   -khtml-border-radius: 5px;  border-radius: 5px; padding:10px\">\r
\r
<div><b>Installation Completed!</b></div>\r
<p>\r
    Your Admin Username is <b>admin</b>\r
</p>    \r
<p>\r
    Your Admin Password is <b>admin</b>    \r
</p>\r
\r
<p>\r
   your admin panel url is <a";
			echo " href=\"";
			echo $site_url;
			echo "admin_cp/\"><b>";
			echo $site_url;
			echo "admin_cp/</b></a>\r
</p>\r
<p>\r
   You can update site settings in admin panel settings module. Please remove this install.php \r
</p>\r
\r
\r
</div>\r
\r
\r
";
			return;
		}
	}
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r
<html xmlns=\"http://www.w3.org/1999/xhtml\">\r
<head>\r
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r
<title>..:|PPD Site Installer|:..</title>\r
";
echo "<s";
echo "tyle type=\"text/css\">\r
\r
.settings{font-size:13px; color:#333333; }\r
.input{border:1px solid #cccccc; width:200px; height:25px; -moz-border-radius: 4px;  -webkit-border-radius: 4px;   -khtml-border-radius: 4px;  border-radius: 4px;}\r
\r
</style>\r
</head>\r
\r
<body>\r
<br /><br />\r
<div style=\"width:500px; margin:0 auto\"><b>PPD Script Installer</b>\r
<br /><br />\r
";
if (!empty($error))
{
	echo "<div style='color:#ff0000'><b>Error:</b> " . $error . "</div><br />";
}
echo "</div>\r
\r
\r
<div style=\"background:#eeeeee; width:500px; height:300px; margin:0 auto; border:1px solid #cccccc; -moz-border-radius: 5px;  -webkit-border-radius: 5px;   -khtml-border-radius: 5px;  border-radius: 5px;\">\r
<form action=\"install.php\" method=\"post\">\r
<table class=\"settings\" cellspacing=\"10\">\r
<tr><td>SITE NAME <div style=\"font-size:12px;\">(Only Letters, Numbers, Hyphen(-) & underscore(_)<br /> ";
echo "dont use Spaces. e.g: HotShareCash)</div></td><td><input type=\"text\" name=\"site_name\"  class=\"input\" value=\"";
echo $_POST["site_name"];
echo "\"></td></tr>\r
<tr><td>SITE URL</td><td><input type=\"text\" name=\"site_url\" class=\"input\" value=\"";
echo $site_url;
echo "\" readonly=\"readonly\"></td></tr>\r
<tr><td>SITE DESCRIPTION</td><td><input type=\"text\" name=\"site_description\" class=\"input\" value=\"";
echo $_POST["site_description"];
echo "\"></td></tr>\r
<tr><td>SITE KEYWORDS <br />(separated by commer i.e word1, word2, word3)</td><td><input type=\"text\" class=\"input\" name=\"site_keywords\" value=\"";
echo $_POST["site_keywords"];
echo "\"></td></tr>\r
\r
<tr><td>NOTIFICATION EMAIL <br />(this would be used for all notification send to users)</td><td><input type=\"text\" name=\"notification_email\" value=\"";
echo $_POST["notification_email"];
echo "\"></td></tr>\r
<tr><td>ADMIN EMAIL <br />(this would be used to send message to Admin)</td><td><input type=\"text\" name=\"admin_email\" value=\"";
echo $_POST["admin_email"];
echo "\"></td></tr>\r
\r
\r
<tr><td colspan=\"2\" style=\"text-align:center; padding-top:5px;\"><input type=\"submit\" name=\"save\" value=\"Install And Save Settings\" /></td></tr>\r
</table>\r
</form>\r
\r
</div>\r
\r
</body>\r
</html>\r
\r
\r
\r
\r
";

